import { Controller, Post, Body } from "@nestjs/common";
import { UserService } from "../services/user.service";
import { UserEntity } from "../entities/user.entity";

@Controller("admin/sys/user")
export class UserWebController {
  constructor(private userService:UserService) {}

  @Post("save")
  async save(@Body() user:UserEntity) {
    return this.userService.save(user);
  }

  @Post("list")
  async findList(){
    return this.userService.findList();
  }

  @Post("find")
  async findOne(@Body() { id }) {
    return this.userService.find(id);
  }

  @Post("delete")
  async delete(@Body() { id }) {
    return this.userService.delete(id);
  }
}